chore(gax-grpc): Update the ChannelPool warning message to point to the Gax Channel Pool guide#12930
chore(gax-grpc): Update the ChannelPool warning message to point to the Gax Channel Pool guide#12930
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CHANNEL_POOL_CONSECUTIVE_RESIZING_WARNING message in ChannelPool.java to include a new documentation link and clarify the resizing threshold. Feedback was provided regarding the length of the warning string, which exceeds the 100-character line limit, suggesting a multi-line approach for better readability.
| + "Consider adjusting `initialChannelCount` or `maxResizeDelta` to a more reasonable value. " | ||
| + "See https://docs.cloud.google.com/java/docs/troubleshooting to enable logging " | ||
| + "and set `com.google.api.gax.grpc.ChannelPool.level=FINEST` to log the channel pool resize behavior."; | ||
| "The gRPC ChannelPool used in the client has been flagged to be repeatedly resizing (5+ times). See https://github.com/googleapis/google-cloud-java/blob/main/docs/grpc_channel_pool_guide.md for more information about this behavior."; |
There was a problem hiding this comment.
The warning message string is very long (over 200 characters), which hinders readability and violates the standard 100-character line limit. While long URLs are sometimes allowed to exceed the limit, the preceding and following text should be wrapped. Additionally, per repository rules, prefer using StringBuilder for multi-line string concatenations in Java, as it is generally more performant than using the + operator.
| "The gRPC ChannelPool used in the client has been flagged to be repeatedly resizing (5+ times). See https://github.com/googleapis/google-cloud-java/blob/main/docs/grpc_channel_pool_guide.md for more information about this behavior."; | |
| new StringBuilder() | |
| .append("The gRPC ChannelPool used in the client has been flagged to be repeatedly ") | |
| .append("resizing (5+ times). See ") | |
| .append("https://github.com/googleapis/google-cloud-java/blob/main/docs/grpc_channel_pool_guide.md ") | |
| .append("for more information about this behavior.") | |
| .toString(); |
References
- Each line of text is limited to 100 characters. While there is an exception for long URLs, the surrounding text should be wrapped to keep the code readable. (link)
- Prefer StringBuilder for multi-line string concatenations in Java, especially when performance is a consideration, as it is generally more performant than using the + operator.
|
|



No description provided.